#include <iostream>

using namespace std;

int main () {
    int n;
    int i;
    bool flag = true;

    cin >> n;
    for (i = 2; i < n; i++) {
        if (n % i == 0) {
            flag = false;
            break;
        }
    }
    if (flag == true && n > 1) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}